VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsSaveHeader"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Public Function SaveHeader() As Boolean

Dim adoConn As ADODB.Connection
Dim adoComm As ADODB.Command


Dim SQL As String
Dim lrecordsaffected As Integer


On Error GoTo PROC_ERROR

SQL = "Insert into dir_xml_header(integration_ID,type,process_date,process_time,requestor_name,"
SQL = SQL & "requestor_user_id,requestor_email,request_status,com_id,"
SQL = SQL & "buni_id,message_id,reference_id,req_seq_num,form_type) values ('"
SQL = SQL & IntegrationID & "' , '" & KeyTaxType & "' , '" & dtDate & "' , '" & dtTime & "' , '"
SQL = SQL & sName & "' , '" & strUser & "' , '" & sEmailTo & "' , '" & nReqStatus & "' , '"
SQL = SQL & nComId & "' , '" & nBuId & "' , '" & nMsgId & "' , '" & nReferenceId & "' , " & nReqSeqNum & ",'" & sFormType & "')"

Set adoConn = New ADODB.Connection
With adoConn
    .CursorLocation = adUseClient
    .ConnectionString = GetConnectionString() 'Johann (20090625): Centralised code for connection string added
    .Open
End With

Set adoComm = New ADODB.Command
With adoComm
    .CommandText = SQL
    .CommandType = adCmdText
    Set .ActiveConnection = adoConn
End With
    
adoComm.Execute lrecordsaffected

If lrecordsaffected > 0 Then
    SaveHeader = True
Else
    SaveHeader = False
End If

'clean up
adoConn.Close
Set adoConn = Nothing
Set adoComm = Nothing

PROC_EXIT:
    Exit Function

PROC_ERROR:
    SaveHeader = False
    Err.Raise Err.Number, _
            "clsSaveHeader/SaveHeader", _
            Err.Description

Resume PROC_EXIT

End Function 'SaveHeader()
